//
//  ContentCollectionViewCell.m
//  BeautifulLockerRoom
//
//  Created by mac on 16/7/29.
//  Copyright © 2016年 Winny. All rights reserved.
//

#import "ContentCollectionViewCell.h"

@implementation ContentCollectionViewCell

-(UIImageView *)imgView
{
    if (!_imgView)
    {
        
        _imgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, WINDOWWIDTH/2-4, WINDOWWIDTH/2 - 4)];
        
    }
    return _imgView;
}
-(UILabel *)contentLabel
{
    if (!_contentLabel)
    {
        _contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, WINDOWWIDTH/2, WINDOWWIDTH/2, 60)];
        _contentLabel.numberOfLines = 0;
        _contentLabel.textColor = [UIColor grayColor];
        _contentLabel.textAlignment = NSTextAlignmentLeft;
        _contentLabel.font = [UIFont systemFontOfSize:15];
    }
    return _contentLabel;
}
-(UILabel *)priceLabel
{
    if (!_priceLabel)
    {
        _priceLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, WINDOWWIDTH/2 + 60, WINDOWWIDTH/4, 30)];
        _priceLabel.numberOfLines = 0;
        _priceLabel.textAlignment = NSTextAlignmentLeft;
        _priceLabel.font = [UIFont systemFontOfSize:15];
        _priceLabel.textColor = [UIColor redColor];
    }
    return _priceLabel;
}
-(UILabel *)numberLabel
{
    if (!_numberLabel)
    {
        _numberLabel = [[UILabel alloc]initWithFrame:CGRectMake(WINDOWWIDTH/4, WINDOWWIDTH/2 + 60, WINDOWWIDTH/8, 30)];
        _numberLabel.numberOfLines = 0;
        _numberLabel.textAlignment = NSTextAlignmentRight;
        _numberLabel.font = [UIFont systemFontOfSize:12];
        _numberLabel.textColor = [UIColor redColor];
    }
    return _numberLabel;
}
-(UILabel *)haveToSell
{
    if (!_haveToSell) {
        _haveToSell = [[UILabel alloc]initWithFrame:CGRectMake(WINDOWWIDTH/4 + WINDOWWIDTH /8, WINDOWWIDTH/2 + 60, WINDOWWIDTH/8 , 30)];
        _haveToSell.numberOfLines = 0;
        _haveToSell.text = @"件已售";
        _haveToSell.textAlignment = NSTextAlignmentLeft;
        _haveToSell.font = [UIFont systemFontOfSize:12];
        _haveToSell.textColor = [UIColor lightGrayColor];
    }
    return _haveToSell;
}
-(instancetype)initWithFrame:(CGRect)frame
{
    
    if (self = [super initWithFrame:frame])
    {
        [self.contentView addSubview:self.imgView];
        [self.contentView addSubview:self.contentLabel];
        [self.contentView addSubview:self.priceLabel];
        [self.contentView addSubview:self.numberLabel];
        [self.contentView addSubview:self.haveToSell];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

@end
